<template>
	<div class="mechanismregAdd">
		<div class="container">
			<div class="container-main">
				<Form ref="formValidate" :model="formValidate" :rules="ruleValidate">
					<Row>
						<Col span="23" class="left-part" v-if="reviewStatus == 3 && bohui != 1 ">
							<div class="title" style="color:#fc6c49">驳回原因</div>
							<Row style="margin: 0 15px 20px 0">
								<Col span="23">    
									<!-- 审核意见 -->
									<div class="address">
										<div class="left">
											<span>审核意见：</span>
										</div>
										<div>{{formValidate.reviewComments}}</div>
									</div>  
								</Col>
							</Row> 
						</Col>
						<!-- 机构基本信息 -->
						<Col span="24" class="left-part">
							<div class="title">机构基本信息
								<span style="color:#ff9966;margin-left:20px;font-size:14px">(提示：可通过输入“统一社会信用代码”导入机构信息)</span>
							</div>
							<Row style="margin-right: 15px">
								<Col span="8">    
								<!-- 机构地址 -->
								<div class="region">
									<div class="left">
									<span>医院地址：</span>
									</div>
									<div class="right" v-if="notReview"> 
									<FormItem :rules="genAddressRule(formValidate)">
										<newfourLevelLinkage
											v-if="notReview"
											@changeProvince="changeProvince"
											@changeCity="changeCity"
											@changeArea="changeArea"
											:province="Number(formValidate.provinceCode)"
											:city="Number(formValidate.cityCode)"
											:area="Number(formValidate.districtCode)"   
											:jianguan='jianguan' 
											ref="newfourLevelLinkage">
										</newfourLevelLinkage>
									</FormItem>
									</div>
									<div class="right" v-if="!notReview">
									<FormItem prop="districtCode" :rules="genAddressRule(formValidate)">
										<div style="height:35px" v-if="!notReview" >
											<span>{{($store.getters.getProvinceList.filter(item => item.id == formValidate.provinceCode)[0] || {}).name}}</span>
											<span>{{($store.getters.getCityList(formValidate.provinceCode).filter(item => item.id == formValidate.cityCode)[0] || {}).name}}</span>
											<span>{{($store.getters.getAreaList(formValidate.cityCode).filter(item => item.id == formValidate.districtCode)[0] || {}).name}}</span>
										</div>
									</FormItem>    
									</div>  
								</div> 
								<!-- 单位法人姓名： -->
								<div class="address hongdian">
									<div class="left">
									<span style="color:red;">*</span>
									<span>单位法人姓名：</span>
									</div>
									<FormItem class="right" prop="legalPerson">
									<Input
										v-if="notReview"
										v-model.trim="formValidate.legalPerson"
										placeholder
										clearable
										style="100%"
									></Input>
									<div style="height:35px" v-else>{{formValidate.legalPerson}}</div>
									</FormItem>
								</div>   
								<!-- 主要负责人： -->
								<div class="address">
									<div class="left">
									<span>主要负责人：</span>
									</div>
									<FormItem class="right">
									<Input
										v-if="notReview"
										v-model.trim="formValidate.linkman"
										placeholder
										clearable
										style="margin-right:10px"
									/>
									<div style="height:35px" v-else>{{formValidate.linkman}}</div>
									</FormItem>
								</div> 
								<!-- 组织类 -->
								<div class="address">
									<div class="left">
									<span>组织类：</span>
									</div>
									<div class="right" v-if="notReview">
									<FormItem prop="hospitalNature">
										<Select v-if="notReview" v-model="formValidate.hospitalNature" style="margin-right:5px">
										<Option
											v-for="item in yljglb"
											:value="item.dictName"
											:key="item.dictType"
										>{{ item.dictName }}</Option>
										</Select>
										<div style="height:35px" v-else class="content">{{(yljglb.filter((item) => formValidate.hospitalNature === item.dictValue)[0] || {}).dictName}}</div>
									</FormItem>
									</div>
									<div class="right" v-if="!notReview">
									<Row gutter="12">
										<Col span="6">
										<FormItem prop="hospitalNature">                          
											<div style="height:35px" class="content">{{(yljglb.filter((item) => formValidate.hospitalNature === item.dictValue)[0] || {}).dictName}}</div>
										</FormItem>
										</Col>
									</Row>
									</div>
								</div>
								<!-- 医院联系电话 -->
								<div class="address">
									<div class="left">
									<span>医院联系电话：</span>
									</div>
									<FormItem class="right">
									<Input
										v-if="notReview"
										v-model.trim="formValidate.linkmanTelephone"
										maxlength = '25'
										placeholder
										clearable
									/>
									<div style="height:35px" v-else>{{formValidate.linkmanTelephone}}</div>
									</FormItem>
								</div>            
								</Col>                 
								<Col span="8">
									<!-- 统一社会信用代码 -->
									<div class="address" style="margin-left: 25px;">
										<div class="left">
											<span style="color:red;">*</span>
											<span>统一社会信用代码：</span>
										</div>
										<FormItem class="right" prop="orgCode">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.orgCode"
												@on-change='changeDrdisabled'
												placeholder
												style="100%"
												disabled='true'
											></Input>
											<div style="height:35px" v-else>{{formValidate.orgCode}}</div>
										</FormItem>
									</div>
									<!-- 执业许可登记号 -->
									<div class="address">
										<div class="left">
											<span>执业许可登记号：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.practiceLicense"
											placeholder
											clearable
											style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.practiceLicense}}</div>
										</FormItem>
									</div>
									<!-- 机构等位分级 -->
									<div class="address">
										<div class="left">
											<span>机构等位分级：</span>
										</div>
										<FormItem class="right">
											<Select v-if="notReview" v-model="formValidate.grade">
											<Option
												v-for="item in kbahospitalLevel"
												:value="item.dictType"
												:key="item.dictType"
											>{{ item.dictName}}</Option>
											</Select>
											<div style="height:35px" v-else class="content">{{(kbahospitalLevel.filter((item) => formValidate.grade === item.dictType)[0] || {}).dictName}}</div>
										</FormItem>                      
									</div>
									<!-- 单位隶属 -->
									<div class="address">
										<div class="left" style="width: 70px">
											<span>单位隶属：</span>
										</div>
										<FormItem class="right">
											<Select v-if="notReview" v-model="formValidate.orgParentCode">
											<Option
												v-for="item in hospitalSuperior"
												:value="item.orgCode"
												:key="item.orgCode"
												style="z-index:99999"
											>{{ item.orgName }}</Option>
											</Select>
											<div style="height:35px" v-else class="content">{{(hospitalSuperior.filter((item) => formValidate.orgParentCode === item.orgCode)[0] || {}).orgName}}</div>
										</FormItem>
									</div>
									<!-- 单位介绍 -->
									<div class="address">
										<div class="left">
											<span>单位介绍：</span>
										</div>
										<FormItem class="right">
											<docUploadFile :src="formValidate.hosIntroduction" @getUrl="getUploadUrl" v-if="notReview" ></docUploadFile>
											<a :href="fileBaseUrl+formValidate.hosIntroductionUrl">{{formValidate.hosIntroduction}}</a>
											<!-- action="/hospital/uploadOperateFiles" -->
											<!-- <Upload :action="uploadUrl">
												<Button icon="ios-cloud-upload-outline">选择文件</Button>
												<span style="color: #ff9966;margin-left:30px">支持 word 或 pdf 格式</span>
											</Upload> -->
											
											<!-- <span>未选择任何文件</span> -->
											<!-- <Upload 
												ref="uploadword"
												multiple='true' 
												:show-upload-list="true" 
												:before-upload="handleUploadword"
												:data="uploadFile"
												:on-success="uploadSuccess" 
												:headers='{"Authorization": session}'
												:action="uploadUrl" 
											>
												<Button icon="ios-cloud-upload-outline">选择上传文件</Button>
											</Upload> -->
										</FormItem>
										
									</div>  
								</Col>
								<Col span="8">
									<!-- 单位名称 -->
									<div class="address hongdian" >                     
										<div class="left">  
											<span style="color:red;">*</span>                      
											<span>单位名称：</span>
										</div>
										<FormItem class="right" prop="orgName">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.orgName"
												placeholder="请输入机构名称" 
												style="width:75%"           disabled='true'            
											></Input>
											<Button type="primary" @click="leading" v-if="notReview" :disabled="drdisabled">调取导入</Button>
											<div style="height:35px" v-else>{{formValidate.orgName}}</div>
											<!-- <b>仅限与平台已做接口对接机构</b> -->
										</FormItem> 
									</div>
									<!-- 机构第二名称 -->
									<div class="address" >                     
										<div class="left">                     
											<span>机构第二名称：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.orgSecondName"
											placeholder="请输入机构名称"
											clearable                         
											></Input>
											<div style="height:35px" v-else>{{formValidate.orgSecondName}}</div>
										</FormItem>
									</div>
									<!-- 经济类型 -->
									<div class="address">
										<div class="left" style="width: 70px">
											<span>经济类型：</span>
										</div>
										<FormItem class="right" prop="orgParentCode">
											<Select v-if="notReview" v-model="formValidate.economicType">
											<Option
												v-for="item in economics"
												:value="item.dictType"
												:key="item.dictType"
												style="z-index:99999"
											>{{ item.dictName }}</Option>
											</Select>
											<div style="height:35px" v-else class="content">{{(economics.filter((item) => formValidate.economicType === item.dictType)[0] || {}).dictName}}</div>
										</FormItem>
									</div>
									<!-- 医院具体地址 -->
									<div class="address">
										<div class="left">
											<span>医院具体地址：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.hosAddr"
											placeholder="请输入详细地址"
											clearable
											></Input>
											<div style="height:35px" v-if="!notReview">{{formValidate.hosAddr}}</div>
										</FormItem>
									</div>
								</Col>
							</Row>
						</Col>
						<!-- 资质证明材料上传 -->
						<Col span="24" class="right-part">
							<div class="title"  style="margin-bottom: 40px">资质证明材料上传
								<span v-if="notReview" style="color: #FF9966;fontSize: 14px;marginLeft:35px;margin-bottom: 10px">(注意:图片只能上传jpg格式，且文件大小不超过200KB)</span>
							</div>
							<Row>
								<Col span="8">
								<!-- 医院照片 -->                 
								<div class="address">
									<div class="left">
									<span>医院照片：</span>
									</div>
									<FormItem style="display:flex;">
									<div class="upload-part" style="height:100px;width:100px;">
										<div>
										<div class="demo-upload-list" v-for="(item,index) in uploadList1" :key="index"
										>
											<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
											<img :src="fileBaseUrl + item.res.fileName">
											<div class="demo-upload-list-cover">
												<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
												<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('1', item)"></Icon>
											</div>
											</div>
											<div v-else style="height:100px;width:100px;">
											<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
											</div>
										</div>
										</div>
										<Upload
										v-show="uploadList1.length ==0"
										ref="upload1"
										:headers="fromData"
										:action="uploadUrl"
										:default-file-list="defaultList1"
										:format="['jpg']"
										:on-format-error="uploadFormatError"
										max-size="200"
										:on-exceeded-size="handleMaxSize"
										:before-upload="() => preview('1')"
										multiple
										type="drag"
										:data="uploadData"
										:on-success="(res, file) => handleSuccess(res, file, '1')"
										:show-upload-list="noshow">
										<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
											<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
										</div>
										</Upload>
									</div>
									</FormItem>
								</div>
								<!-- 法人身份证正面 -->
								<div class="address">
									<div class="left">
									<span style="color:red;">*</span>
									<span>法人身份证正面：</span>
									</div>
									<FormItem prop="upload4" style="display:flex;">
										<div class="upload-part" style="height:100px;width:100px;">
										<div >
											<div class="demo-upload-list" v-for="(item,index) in uploadList4" :key="index" style="height:100px">
											<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
												<img :src="fileBaseUrl + item.res.fileName">
												<div class="demo-upload-list-cover">
												<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
												<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('4', item)"></Icon>
												</div>
											</div>
											<div v-else style="height:100px;width:100px;">
												<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
											</div>
											</div>
										</div>
										<Upload
											v-show="uploadList4.length ==0"
											ref="upload4"
											:headers="fromData"
											:action="uploadUrl"
											:default-file-list="defaultList4"
											:format="['jpg']"
											:on-format-error="uploadFormatError"
											max-size="200"
											:on-exceeded-size="handleMaxSize"
											:before-upload="() => preview('4')"
											:data="uploadData"
											:on-success="(res, file) => handleSuccess(res, file, '4')"
											:show-upload-list="noshow"
											multiple
											type="drag"
											
										>
											<!-- style="display: inline-block;width:98px;height:98px;" -->
											<!-- <Button v-if="notReview" type="primary" class="button-upload">选择文件上传</Button> -->
											<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
												<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
											</div>
										</Upload>
										</div>
									</FormItem>
								</div>
								</Col>
								<Col span="8">
								<!-- 营业执照 -->
								<div class="address">
									<div class="left">
									<span style="color:red;">*</span>
									<span>营业执照：</span>
									</div>
									<FormItem prop="upload2" style="display:flex;">
									<div class="upload-part" style="height:100px;width:100px;">
										<div >
										<div class="demo-upload-list" v-for="(item,index) in uploadList2" :key="index" style="height:100px;">
											<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
											<img :src="fileBaseUrl + item.res.fileName">
											<div class="demo-upload-list-cover">
												<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
												<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('2', item)"></Icon>
											</div>
											</div>
											<div v-else style="height:100px;width:100px;">
											<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
											</div>
										</div>
										</div>                         
										<Upload
											v-show="uploadList2.length ==0"
											ref="upload2"
											:headers="fromData"
											:action="uploadUrl"
											:default-file-list="defaultList2"
											:format="['jpg']"
											:on-format-error="uploadFormatError"
											max-size="200"
											:on-exceeded-size="handleMaxSize"
											:before-upload="() => preview('2')"
											:data="uploadData"
											:on-success="(res, file) => handleSuccess(res, file, '2')"
											:show-upload-list="noshow"
											multiple
											type="drag"
											
										>
											<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
												<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
											</div>
										</Upload>
									</div>
									</FormItem>
								</div>
								<!-- 法人身份证反面 -->
								<div class="address">
									<div class="left">
										<span style="color:red;">*</span>
										<span>法人身份证反面：</span>
									</div>
									<FormItem prop="upload5" style="display:flex;">
										<div class="upload-part" style="height:100px;width:100px;">
											<div >
												<div class="demo-upload-list" v-for="(item,index) in uploadList5" :key="index">
													<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
													<img :src="fileBaseUrl + item.res.fileName">
													<div class="demo-upload-list-cover">
														<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
														<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('5', item)"></Icon>
													</div>
													</div>
													<div v-else style="height:100px;width:100px;">
													<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
													</div>
												</div>
											</div>                        
											<Upload
												v-show="uploadList5.length ==0"
												ref="upload5"
												:headers="fromData"
												:action="uploadUrl"
												:default-file-list="defaultList5"
												:format="['jpg']"
												:on-format-error="uploadFormatError"
												max-size="200"
												:on-exceeded-size="handleMaxSize"
												:before-upload="() => preview('5')"
												:data="uploadData"
												:on-success="(res, file) => handleSuccess(res, file, '5')"
												:show-upload-list="noshow"
												multiple
												type="drag"
												
											>
												<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
													<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
												</div>
											</Upload>
										</div>
									</FormItem>
								</div>
								</Col>
								<Col span="8">
								<!-- 执业许可证--> 
								<div class="address">
									<div class="left">
									<span style="color:red;">*</span>
									<span>执业许可证：</span>
									</div>
									<FormItem prop="upload3" style="display:flex;">
									<div class="upload-part" style="height:100px;width:100px;">
										<div >
										<div class="demo-upload-list" v-for="(item,index) in uploadList3" :key="index">
											<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
											<img :src="fileBaseUrl + item.res.fileName">
											<div class="demo-upload-list-cover">
												<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
												<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('3', item)"></Icon>
											</div>
											</div>
											<div v-else style="height:100px;width:100px;">
											<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
											</div>
										</div>
										</div>                       
										<Upload
											v-show="uploadList3.length ==0"
											ref="upload3"
											:headers="fromData"
											:action="uploadUrl"
											:default-file-list="defaultList3"
											:format="['jpg']"
											:on-format-error="uploadFormatError"
											max-size="200"
											:on-exceeded-size="handleMaxSize"
											:before-upload="() => preview('3')"
											:data="uploadData"
											:on-success="(res, file) => handleSuccess(res, file, '3')"
											:show-upload-list="noshow"
											multiple
											type="drag"
											
										>
											<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
												<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
											</div>
										</Upload>
									</div>
									</FormItem>
								</div> 
								</Col>
							</Row>
						</Col>
						<!-- 拟开展互联网医疗服务 -->
						<Col span="23" class="left-part">
							<div class="title"><span style="color:red;">*</span>拟开展互联网医疗服务</div>
							<Row>
								<Col span="23"> 
									<div class="fuwu">
										<!-- 医生服务-->
										<div class="xsfw">
											<!--第一行-->
											<div class="select_wufu" ref="all">
												<template>
													<div v-for="(item,index) of allServerList" :key='index'>
														<Checkbox 
														:disabled = 'cstbdisabled' v-model="item.flag">{{ item.menuName }}</Checkbox>
													</div>
												</template>
											</div>
										</div>
									</div>
									<div class="address">
										<div class="left" style="margin-left:30px">
											<span>开展互联网医疗服务-其他项说明：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.otherServices"
											placeholder
											clearable
											style="80%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.otherServices}}</div>
										</FormItem>
									</div>
								</Col>
							</Row> 
						</Col>
						<!-- 拟开展的临床科室 -->
						<Col span="23" class="left-part">
							<div class="title"><span style="color:red;">*</span>拟开展的临床科室
								<Button type="info" style="float: right;margin:5px 20px" @click="insertDept" v-if="notReview">新增科室</Button>
							</div>
							<div class="fuwu">
								<!-- 医生服务-->
								<div class="xsfw">
									<!--第一行-->
									<div class="select_wufu" ref="all">
										<template>
											<div v-for="(item,index) of departmentList" :key='index' style="font-size: 14px;">
												<i class = "iconfont icon-butongyi tubiao" @click="deldepartment(item.id)" v-if="notReview" ></i>
												<span>{{ item.dictName }}</span>
											</div>
										</template>
									</div>
								</div>
							</div>
						</Col>
						<!-- 平台相关协议内容 -->
						<Col span="23" class="left-part">
							<div class="title">平台相关协议内容
								<b class="b">( 协议支持上传 word 或 pdf 格式 )</b>
							</div>
							<!-- 1.患者端协议 -->
							<div class="protocol">
								<div class="dsort">
									<span>1.协议类型：患者端协议</span> 
								</div>
								<div class="sort asd">
									<span >协议名称:</span>
									<div class="inputbox">
										<Input
											v-if="notReview"
											v-model.trim="patientProtocol.protocolName"
											placeholder="请输入协议名称"
											clearable>
										</Input>
										<span style="height:35px" v-else>{{patientProtocol.protocolName}}</span>
									</div>
								</div>
								<div class="address">
									<div class="left">
										<span>上传协议内容：</span>
									</div>
									<FormItem class="right">
										<docUploadFile :src="patientProtocol.protocolContentUrl" @getUrl="getPatientProtocolUrl" v-if="notReview" ></docUploadFile>
										<a :href="fileBaseUrl+patientProtocol.protocolContentUrl">{{patientProtocol.protocolContent}}</a>
									</FormItem>
								</div>
							</div>
							<!-- 2.协议类型：患者端协议 -->
							<div class="protocol">
								<div class="dsort">
									<span>2.协议类型：医生端协议</span> 
								</div>
								<div class="sort asd">
									<span >协议名称:</span>
									<div class="inputbox">
										<Input
											v-if="notReview"
											v-model.trim="doctorProtocol.protocolName"
											placeholder="请输入协议名称"
											clearable>
										</Input>
										<span style="height:35px" v-else>{{doctorProtocol.protocolName}}</span>
									</div>
								</div>
								<div class="address">
									<div class="left">
										<span>上传协议内容：</span>
									</div>
									<FormItem class="right">
										<docUploadFile :src="doctorProtocol.protocolContentUrl" @getUrl="getDoctorProtocolUrl" v-if="notReview" ></docUploadFile>
										<a :href="fileBaseUrl+doctorProtocol.protocolContentUrl">{{doctorProtocol.protocolContent}}</a>
									</FormItem>
								</div>
							</div>
							<!-- 3.协议类型：患者端协议 -->
							<div class="protocol">
								<div class="dsort">
									<span>3.协议类型：其他协议</span> 
								</div>
								<div class="sort asd">
									<span >协议名称:</span>
									<div class="inputbox">
										<Input
											v-if="notReview"
											v-model.trim="otherProtocol.protocolName"
											placeholder="请输入协议名称"
											clearable>
										</Input>
										<span style="height:35px" v-else>{{otherProtocol.protocolName}}</span>
									</div>
								</div>
								<div class="address">
									<div class="left">
										<span>上传协议内容：</span>
									</div>
									<FormItem class="right">
										<docUploadFile :src="otherProtocol.protocolContentUrl" @getUrl="getOtherProtocolUrl" v-if="notReview" ></docUploadFile>
										<a :href="fileBaseUrl+otherProtocol.protocolContentUrl">{{otherProtocol.protocolContent}}</a>
									</FormItem>
								</div>
							</div>	
						</Col>
						<!-- 互联网医院设立情况 -->
						<Col span="24" class="left-part">
							<div class="title">互联网医院设立情况
								<b class="b">( 协议支持上传 word 或 pdf 格式 )</b>
							</div>
							<Row style="margin-right: 15px">
								<Col span="8">    
									<!-- 医疗质量管理部门 -->
									<div class="address">
										<div class="left">
											<span>医疗质量管理部门：</span>
										</div>
										<FormItem class="right">
										<iSwitch size="large" v-model="formValidate.situation.qualitySupervision" :disabled = 'cstbdisabled'>
											<span slot="open">是</span>
											<span slot="close">否</span>
										</iSwitch>
										</FormItem>
									</div>   
									<!-- 服务器型号 -->
									<div class="address">
										<div class="left">
										<span>服务器型号：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.serverModel"
												placeholder
												clearable
												style="margin-right:10px"
											/>
											<div style="height:35px" v-else>{{formValidate.situation.serverModel}}</div>
										</FormItem>
									</div> 
									<!-- 音视频系统型号 -->
									<div class="address">
										<div class="left">
											<span>音视频系统型号：</span>
										</div>
										<FormItem>
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.systemMode"
												placeholder
												clearable
												style="margin-right:10px"
											/>
											<div style="height:35px" v-else>{{formValidate.situation.systemMode}}</div>
										</FormItem>
									</div>
									<!-- 传输链路宽带 -->
									<div class="address">
										<div class="left">
											<span>传输链路宽带：</span>
										</div>
										<FormItem class="right" prop="linkmanTelephone">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.bandwidth"
												maxlength = '25'
												placeholder
												clearable
											/>
											<div style="height:35px" v-else>{{formValidate.situation.bandwidth}}</div>
										</FormItem>
									</div>        
									<!-- 信息系统技术手册文件名称 -->
									<div class="address">
										<div class="left">
											<span>信息系统技术手册文件名称：</span>
										</div>
										<FormItem class="right" prop="linkmanTelephone">
											<docUploadFile :src="technicalManualUrl" @getUrl="gettechnicalManualUrl" v-if="notReview"></docUploadFile>
											<a :href="fileBaseUrl+technicalManualUrl">{{technicalManual}}</a>
										</FormItem>
									</div>  
									<!-- 信息系统安全等级保护级别 -->
									<div class="address hongdian">
										<div class="left">
											<span style="color:red;">*</span>
											<span>信息系统安全等级保护级别：</span>
										</div>
										<FormItem class="right" prop="safetyLevel" >
											<Select v-if="notReview" v-model="formValidate.safetyLevel">
												<Option
													v-for="item in infoProteLevel"
													:value="item.dictType"
													:key="item.dictType"
												>{{ item.dictName}}</Option>
											</Select>
											<div style="height:35px" v-else class="content">{{(infoProteLevel.filter((item) => formValidate.safetyLevel === item.dictType)[0] || {}).dictName}}</div>
										</FormItem>                      
									</div>     
									<!-- 电子病历等级 -->
									<div class="address">
										<div class="left">
											<span>电子病历等级：</span>
										</div>
										<FormItem class="right">
											<Select v-if="notReview" v-model="formValidate.situation.emrLevel">
												<Option
													v-for="item in emrLevel"
													:value="item.dictType"
													:key="item.dictType"
												>{{ item.dictName}}</Option>
											</Select>
											<div style="height:35px" v-else class="content">{{(emrLevel.filter((item) => formValidate.situation.emrLevel === item.dictType)[0] || {}).dictName}}</div>
										</FormItem>                      
									</div>     
									<!-- 区域信息病案共享 -->
									<div class="address">
										<div class="left">
											<span>区域信息病案共享：</span>
										</div>
										<FormItem class="right">
											<iSwitch size="large" v-model="formValidate.situation.isShare" :disabled = 'cstbdisabled'>
												<span slot="open">是</span>
												<span slot="close">否</span>
											</iSwitch>
										</FormItem>
									</div>                     
								</Col>                 
								<Col span="8">
									<!-- 信息技术服务与管理部门 -->
									<div class="address">
										<div class="left">
											<span>信息技术服务与管理部门：</span>
										</div>
										<FormItem class="right">
											<iSwitch size="large" v-model="formValidate.situation.technicalSupervision" :disabled = 'cstbdisabled'>
												<span slot="open">是</span>
												<span slot="close">否</span>
											</iSwitch>
										</FormItem>
									</div>   
									<!-- 服务器数量 -->
									<div class="address">
										<div class="left">
											<span>服务器数量：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.serverNum"
												placeholder
												clearable
												style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.serverNum}}</div>
										</FormItem>
									</div>
									<!-- 音视频系统数量 -->
									<div class="address">
										<div class="left">
											<span>音视频系统数量：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.situation.systemNum"
											placeholder
											clearable
											style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.systemNum}}</div>
										</FormItem>
									</div>
									<!-- 音视频系统数量 -->
									<div class="address">
										<div class="left">
											<span>诊疗服务信息系统名称：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.situation.systemName"
											placeholder
											clearable
											style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.systemName}}</div>
										</FormItem>
									</div>
									<!-- 信息系统操作手册文件名称 -->
									<div class="address">
										<div class="left">
											<span>信息系统操作手册文件名称：</span>
										</div>
										<FormItem class="right" prop="linkmanTelephone">
											<docUploadFile :src="operationManualUrl" @getUrl="getoperationManualUrl" v-if="notReview" ></docUploadFile>
											<a :href="fileBaseUrl+operationManualUrl">{{operationManual}}</a>
										</FormItem>
									</div>  
									<!-- 信息系统安全等级保护级别证书 -->
									<div class="address">
										<div class="left">
											<span>信息系统安全等级保护级别证书：</span>
										</div>
										<FormItem  style="display:flex;">
											<div class="upload-part" style="height:100px;width:100px;">
												<div >
													<div class="demo-upload-list" v-for="(item,index) in uploadList9" :key="index">
														<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
														<img :src="fileBaseUrl + item.res.fileName">
														<div class="demo-upload-list-cover">
															<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
															<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('9', item)"></Icon>
														</div>
														</div>
														<div v-else style="height:100px;width:100px;">
														<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
														</div>
													</div>
												</div>  
												<Upload
													v-show="uploadList9.length ==0"
													ref="upload9"
													:headers="fromData"
													:action="uploadUrl"
													:default-file-list="defaultList9"
													:format="['jpg']"
													:on-format-error="uploadFormatError"
													max-size="1024"
													:on-exceeded-size="handleMaxSize"
													:before-upload="() => preview('9')"
													:data="uploadData"
													:on-success="(res, file) => handleSuccessInfo(res, file, '9')"
													:show-upload-list="noshow"
													multiple
													type="drag"
													
												>
													<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
														<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
													</div>
												</Upload>
											</div>
										</FormItem>
									</div>  
									<!-- 信息系统安全等级保护级别证书 -->
									<div class="address">
										<div class="left">
											<span>电子病历等级证书：</span>
										</div>
										<FormItem style="display:flex;">
											<div class="upload-part" style="height:100px;width:100px;">
												<div >
													<div class="demo-upload-list" v-for="(item,index) in uploadList10" :key="index">
														<div v-if="item.status === 'finished'" style="height:100px;width:100px;">
														<img :src="fileBaseUrl + item.res.fileName">
														<div class="demo-upload-list-cover">
															<Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
															<Icon v-if="notReview" type="ios-trash-outline" @click.native="onremove('10', item)"></Icon>
														</div>
														</div>
														<div v-else style="height:100px;width:100px;">
														<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
														</div>
													</div>
												</div>  
												<Upload
													v-show="uploadList10.length ==0"
													ref="upload10"
													:headers="fromData"
													:action="uploadUrl"
													:default-file-list="defaultList10"
													:format="['jpg']"
													:on-format-error="uploadFormatError"
													max-size="1024"
													:on-exceeded-size="handleMaxSize"
													:before-upload="() => preview('10')"
													:data="uploadData"
													:on-success="(res, file) => handleSuccessDisease(res, file, '10')"
													:show-upload-list="noshow"
													multiple
													type="drag"
													
												>
													<div v-if="notReview" style="width: 98px;height:98px;line-height: 98px;background: #fff;">
														<i class = "iconfont icon-shangchuan" style="font-size:36px;"></i>
													</div>
												</Upload>
											</div>
										</FormItem>
									</div>  
								</Col>
								<Col span="8">
									<!-- 医学服务部门 -->
									<div class="address">
										<div class="left">
											<span>医学服务部门：</span>
										</div>
										<FormItem class="right">
											<iSwitch size="large" v-model="formValidate.situation.serviceSupervision" :disabled = 'cstbdisabled'>
												<span slot="open">是</span>
												<span slot="close">否</span>
											</iSwitch>
										</FormItem>
									</div>   
									<!-- 服务器地址 -->
									<div class="address" >                     
										<div class="left">             
											<span>服务器地址：</span>
										</div>
										<FormItem class="right">
											<Input
											v-if="notReview"
											v-model.trim="formValidate.situation.serverAddress"
											placeholder="请输入服务器地址"
											clearable                         
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.serverAddress}}</div>
										</FormItem>
									</div>
									<!-- 传输链路 -->
									<div class="address" >                     
										<div class="left">             
											<span>传输链路：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.transmissionLink"
												placeholder="请输入传输链路"
												clearable                         
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.transmissionLink}}</div>
										</FormItem>
									</div>
									<!-- 远程医疗互联网服务网址 -->
									<div class="address">
										<div class="left">
											<span>远程医疗互联网服务网址：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.website"
												placeholder="请输入远程医疗互联网服务网址"
												clearable                         
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.website}}</div>
										</FormItem>
									</div>
									<!-- 互联网医院设立可行性研究报告 -->
									<div class="address">
										<div class="left">
											<span>互联网医院设立可行性研究报告：</span>
										</div>
										<FormItem class="right" prop="linkmanTelephone">
											<docUploadFile :src="researchReportUrl" @getUrl="getresearchReportUrl" v-show="notReview"></docUploadFile>
											<a :href="fileBaseUrl+researchReportUrl">{{researchReport}}</a>
										</FormItem>
									</div>  
									<!-- 信息安全等级保护证书获取时间 -->
									<div class="address">
										<div class="left">
											<span>信息安全等级保护证书获取时间：</span>
										</div>
										<FormItem>
											<DatePicker
												v-if="notReview"
												type="date"
												v-model="formValidate.situation.safetyCertTime"
												placeholder="请选择时间"
											></DatePicker>
											<div v-else class="content">{{formValidate.situation.safetyCertTime}}</div>
										</FormItem>
									</div>
									<!-- 电子病历等级证书获取时间 -->
									<div class="address">
										<div class="left">
											<span>电子病历等级证书获取时间：</span>
										</div>
										<FormItem>
											<DatePicker
												v-if="notReview"
												type="date"
												v-model="formValidate.situation.emrCertTime"
												placeholder="请选择时间"
											></DatePicker>
											<div v-else class="content">{{formValidate.situation.emrCertTime}}</div>
										</FormItem>
									</div>
								</Col>
								<Col span="24">
									<div class="address">
										<div class="left">
											<span>与省级互联网医疗服务监管平台对接情况：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.regulatoryPlatformDockingSituation"
												placeholder
												clearable
												style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.regulatoryPlatformDockingSituation}}</div>
										</FormItem>
									</div>
									<div class="address">
										<div class="left">
											<span>与省远程医疗服务平台对接情况：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.servicePlatformDockingSituation"
												placeholder
												clearable
												style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.servicePlatformDockingSituation}}</div>
										</FormItem>
									</div><div class="address">
										<div class="left">
											<span>服务功能：</span>
										</div>
										<FormItem class="right">
											<Input
												v-if="notReview"
												v-model.trim="formValidate.situation.serviceFunction"
												placeholder
												clearable
												style="100%"
											></Input>
											<div style="height:35px" v-else>{{formValidate.situation.serviceFunction}}</div>
										</FormItem>
									</div>
								</Col>
							</Row>
						</Col>
						<!-- 第三方合作模式信息 -->
						<Col span="24" class="left-part">
						<div class="title">第三方合作模式信息
							<b class="b">( 文件支持上传 word 或 pdf 格式 )</b>
						</div>
						<Row>
							<Col span="8">    
							<!-- 第三方合作单位名称 -->
							<div class="region">
								<div class="left">
									<span>第三方合作单位名称：</span>
								</div>
								<FormItem class="right">
									<Input
										v-if="notReview"
										v-model.trim="formValidate.thirdpartyHospital.companyName"
										placeholder
										clearable
										style="100%"
									></Input>
								<div style="height:35px" v-else>{{formValidate.thirdpartyHospital.companyName}}</div>
								</FormItem>
							</div> 
							<!-- 第三方合作单位法人 -->
							<div class="address">
								<div class="left">
									<span>第三方合作单位法人：</span>
								</div>
								<FormItem class="right">
									<Input
										v-if="notReview"
										v-model.trim="formValidate.thirdpartyHospital.legalPerson"
										placeholder
										clearable
										style="100%"
									></Input>
									<div style="height:35px" v-else>{{formValidate.thirdpartyHospital.legalPerson}}</div>
								</FormItem>
							</div>   
							</Col>                 
							<Col span="8">
								<!-- 统一社会信用代码 -->
								<div class="address">
									<div class="left">
										<span>第三方合作统一社会信用代码：</span>
									</div>
									<FormItem class="right">
										<Input
										v-if="notReview"
										v-model.trim="formValidate.thirdpartyHospital.creditCode"
										placeholder
										clearable
										style="100%"
										></Input>
										<div style="height:35px" v-else>{{formValidate.thirdpartyHospital.creditCode}}</div>
									</FormItem>
								</div>
								<!-- 第三方合作法人身份证号 -->
								<div class="address">
									<div class="left">
										<span>第三方合作法人身份证号：</span>
									</div>
									<FormItem class="right">
										<Input
										v-if="notReview"
										v-model.trim="formValidate.thirdpartyHospital.legalPersonCard"
										placeholder
										clearable
										style="100%"
										></Input>
										<div style="height:35px" v-else>{{formValidate.thirdpartyHospital.legalPersonCard}}</div>
									</FormItem>
								</div>
							</Col>
							<Col span="8">   
								<!-- 第三方合作统一社会信用代码证书文件 -->
								<div class="address">
									<div class="left">
										<span>第三方合作统一社会信用代码证书文件：</span>
									</div>
									<FormItem class="right" prop="linkmanTelephone">
										<docUploadFile :src="creditCertUrl" @getUrl="getcreditCertUrl" v-if="notReview"></docUploadFile>
										<a :href="fileBaseUrl+creditCertUrl">{{creditCert}}</a>
									</FormItem>
								</div>  
								<!-- 第三方合作协议合同文件 -->
								<div class="address">
									<div class="left">
										<span>第三方合作协议合同文件：</span>
									</div>
									<FormItem class="right" prop="linkmanTelephone">
										<docUploadFile :src="contractUrl" @getUrl="getcontractUrl" v-if="notReview"></docUploadFile>
										<a :href="fileBaseUrl+contractUrl">{{contract}}</a>
									</FormItem>
								</div>  
							</Col>
						</Row>
						</Col>
						<Col span="24" class="left-part">
							<div class="title">拟派医护人员信息
								<Button type="info" style="float: right;margin:5px 20px" @click="addDoctor" v-if="notReview">新增医生</Button>
								<Button type="info" style="float: right;margin:5px 20px" @click="addpharmacist" v-if="notReview">新增药师</Button>
							</div> 
							<Row>
								<Col span="24">
									<div style="clear:both"></div>
									<Table stripe :columns="columns1" :data="tableList" class="tablebox" height="520"></Table>
								</Col> 
							</Row>
						</Col>
						<Col span="23" class="left-part" v-if="reviewStatus == 1 || reviewStatus == 2 || bohui == 1">
							<div class="title">审核意见
								<span style="color:#ff9966;margin-left:20px;font-size:14px" v-if="reviewStatus == 2">( 已审核 )</span>
							</div>
							<Row style="margin: 0 15px 20px 0" >
								<Col span="23">    
									<!-- 审核意见 -->
									<div class="address">
										<div class="left">
											<span>审核意见：</span>
										</div>
										<div class="left" v-if="reviewStatus == 2 || bohui == 1 || notReview">{{formValidate.reviewComments}}</div>
										<div v-if="reviewStatus == 1 && !cstb" style="width:100%">
											<Input v-model="reviewComments"  type="textarea" :rows="5"   :disabled='notReview?true:false'   placeholder="请输入审核具体意见" />
										</div>
									</div>  
								</Col>
								<Col span="8" v-if="reviewStatus == 2 || bohui == 1">    
									<!-- 审批机构 -->
									<div class="address">
										<div class="left">
											<span>审批机构：</span>
										</div>
										<div class="left">{{formValidate.auditOrgName}}</div>
									</div>  
								</Col>
								<Col span="8" v-if="reviewStatus == 2 || bohui == 1">    
									<!-- 审批人 -->
									<div class="address">
										<div class="left">
											<span>审批人：</span>
										</div>
										<div class="left">{{formValidate.reviewerName}}</div>
									</div>  
								</Col>
								<Col span="8" v-if="reviewStatus == 2 || bohui == 1">    
									<!-- 审批时间 -->
									<div class="address">
										<div class="left">
											<span>审批时间：</span>
										</div>
										<div class="left">{{formValidate.reviewTime}}</div>
									</div>  
								</Col>
							</Row> 
						</Col>
					</Row> 
				</Form>
				<div class="button-bottom">
					<Button type="info" v-if="notReview" @click="handleSubmit('formValidate',1)" :disabled="disabled">
						<Icon type="ios-checkmark" style="margin-right:5px;" size="16" />
						保存并提交
					</Button>
					<Button type="primary" @click="handleSubmit('formValidate',0)" style="margin-left:30px" v-if="notReview" :disabled="disabledZC">
						<i class = "iconfont icon-bianji" style="font-size:14px;margin-right:5px"></i>暂存数据
					</Button>
					<Button type="info" v-if="reviewStatus == 1 && !cstb" @click="showDelModalClick(3)" :disabled="disabled">
						<Icon type="ios-checkmark" style="margin-right:5px;" size="16" />
						驳回申请
					</Button>
					<Button type="primary" @click="showDelModalClick(2)" style="margin-left:30px" v-if="reviewStatus == 1 && !cstb" >
						<i class = "iconfont icon-bianji" style="font-size:14px;margin-right:5px"></i>审核通过
					</Button>
					<Button @click="back" style="margin-left:30px">
						<i class = "iconfont icon-butongyi" style="font-size:14px;margin-right:5px"></i>返回
					</Button>
				</div>
			</div>
		</div>
		<Modal title="预览图片" width="30" v-model="viewModal" footer-hide>
			<div>
				<img :src="viewSrc" style="width: 100%" />
			</div>
		</Modal>
		<!-- 审核/驳回弹窗 -->
		<Modal
			v-model="showDelModal"
			:title= titletxt
		>
			<p v-if="reviewType == 3" >确认驳回该条申请吗？</p>
			<p v-if="reviewType == 2" >确认通过该条申请吗？</p>
			<div slot="footer">
				<Button class="cancel-btn btn" @click="showDelModal = false">取消</Button>
				<Button class="save-btn btn" type="primary" :loading="delLoading" @click="check">确认</Button>
			</div>
		</Modal>
	</div>
</template>

<script>
import api from "@/api/commonApi";
import cookie from "../../../../utils/cookie.js";
import code from "@/configs/base.js";
import vueEditor from "@/components/vueEditor";
import newfourLevelLinkage from "@/components/newfourLevelLinkage";
import { DatePicker } from "view-design";
import docUploadFile from "@/components/docUploadFile";
export default {
	components: {
		newfourLevelLinkage,
		vueEditor,
		DatePicker,
		docUploadFile
	},
	props: {
		mode: String
	},
  	data() {
    	return {
			reviewComments:null,
			jianguan:"JP",
			urlCode: '{"urlCode":"' + code.urlCode.richText + '"}',
			showSpin: false,
			noshow: false,
			uploadData: {
				json: '{"urlCode":"' + code.urlCode.userImage + '"}'
			},
			uploadFile: {
				json: '{"urlCode":"' + code.urlCode.userImage + '"}'
			},
			// 查看列表
			uploadList1: [],
			uploadList2: [],
			uploadList3: [],
			uploadList4: [],
			uploadList5: [],
			uploadList6: [],
			uploadList7: [],
			uploadList10: [],
			uploadList9: [],
			
			defaultList1: [],
			defaultList2: [],
			defaultList3: [],
			defaultList4: [],
			defaultList5: [],
			defaultList10: [],
			defaultList9: [],

			//信息系统技术手册文件
			technicalManual:"",
			technicalManualUrl:"",
			//信息系统操作手册文件
			operationManual:"",
			operationManualUrl:"",
			//互联网医院设立可行性研究报告
			researchReport:"",
			researchReportUrl:"",
			//第三方合作统一社会信用代码证书文件
			creditCert:"",
			creditCertUrl:"",
			//第三方合作协议合同文件
			contract:"",
			contractUrl:"",

			// 预览图片的src
			viewSrc: '',
			// 预览图片Modal
			viewModal: false,
			uploadUrl: api.fileAll,
			// 单位类属
			hospitalSuperior: [],
			//患者端协议
			patientProtocol:{
				protocolType:1,
				protocolTypeName:"患者端协议",
				protocolName:null,
				protocolContent:null,
				protocolContentUrl:null,
			},
			//医生端协议
			doctorProtocol:{
				protocolType:2,
				protocolTypeName:"医生端协议",
				protocolName:null,
				protocolContent:null,
				protocolContentUrl:null,
			},
			//其他协议
			otherProtocol:{
				protocolType:3,
				protocolTypeName:"其他协议",
				protocolName:null,
				protocolContent:null,
				protocolContentUrl:null,
			},
			formValidate: {
				//单位介绍
				hosIntroduction:"",
				hosIntroductionUrl:"",
				hospitalType: 1,
				id: null,
				provinceCode: "",
				provinceName: "",
				// 市
				cityCode: "",
				cityName: "",
				//县
				districtCode: "",
				districtName: "",
				//详细地址
				hosAddr: "",
				//机构名称
				orgName: "",
				//机构组织代码
				orgCode: "",
				//机构分类
				property: null,
				orgParentCode: null,
				grade: null,
				hospitalNature: null,
				protocolList:[],
				//资质证明材料
				hospitalCertList: [
					{
						type: "1",
						code: "",
						filePath: null
					},
					{
						type: "2",
						code: "",
						filePath:null
					},
					{
						type: "3",
						code: "",
						filePath:null
					},
					{
						type: "4",
						code: "",
						filePath: null
					},
					{
						type: "5",
						code: "",
						filePath: null
					}
				],
				//互联网医院设立情况
				situation: {
					safetyLevel:null,
					//信息系统技术手册文件
					technicalManual:"",
					technicalManualUrl:"",
					//信息系统操作手册文件
					operationManual:"",
					operationManualUrl:"",
					//互联网医院设立可行性研究报告
					researchReport:"",
					researchReportUrl:"",
				},
				//第三方合作机构信息
				thirdpartyHospital: {
					//第三方合作统一社会信用代码证书文件
					creditCert:"",
					creditCertUrl:"",
					//第三方合作协议合同文件
					contract:"",
					contractUrl:"",
				},
			},
			ruleValidate: {
				// 单位法人姓名
				legalPerson: [ { required: true, message: "请输入单位法人姓名", trigger: "change" } ],
				// 机构名称
				orgName: [ { required: true, message: "请输入单位名称", trigger: "change" } ],
				// 统一社会信用代码
				orgCode: [ { required: true, message: "请输入统一社会信用代码", trigger: "change" } ],
				//信息系统安全等级保护级别
				safetyLevel: [ { required: true, message: "请选择信息系统安全等级保护级别", trigger: "change" } ],
				upload2: [ { required: false, message: "请上传营业执照", trigger: "change" } ],
				upload3: [ { required: false, message: "请上传执业许可证", trigger: "change" } ],
				upload4: [ { required: false, message: "请上传法人身份证正面", trigger: "change" } ],
				upload5: [ { required: false, message: "请上传法人身份证反面", trigger: "change" } ],
			},
			//城市列表
			provList: [],
			cityList: [],
			countyList: [],

			province: null,
			city: null,
			area: null,
			isBack: 2,
			newprovince: "",
			newcity: "",
			newdistrict: "",
			cStatus: true,
			idtt: "",
			disabled: false,
			disabledZC: false,
			allServiceList: [],
			docServiceList: [],
			departmentList: [],
			pageNo: 1,
            pageSize: 10,
			tableList: [],
			columns1:[
				{
					title: '排序',
					key: 'num',
					align: 'center',
					width: 60,
					render: (h, params) => {
                        let num = (this.pageNo-1)*this.pageSize + params.index +1;
                        return h("span", num);
                    }
				},
				{
					title: '姓名',
					key: 'name',
					align: 'center',
					// width: 80,
				},
				{
					title: '图片',
					key: 'docIcon',
					align: 'center',
					// width: 150,
					render: (h, params) => {
                        let avatar = this.pictureFormat(params.row.docIcon);
                        if (Boolean(avatar)) {
                            avatar = this.fileBaseUrl + avatar;
                        }
                        return h("img", {
                            attrs: {
                                src: avatar || "./static/img/doctor.png",
                                style:
                                    "width:40px;height:40px;border-radius:50%;"
                            }
                        });
                    }
				},
				{
					title: '身份证号',
					key: 'idcard',
					align: 'center',
					// width: 150,
					render: (h, params) => {
						if(params.row.idcard){ 
							var str1= params.row.idcard.slice(0,6);
							var str2='';
							var str3= params.row.idcard.slice(14);
							if(params.row.idcard.length==15){
								str2='*****';
							}else{
								str2='********';
							}
							let idcard = str1+str2+str3
							return idcard;
						}
					}      
				},
				{
					title: '性别',
					key: 'gender',
					align: 'center',
					// width: 120,
					render(h, params) {
						return ['', '男', '女'][params.row.gender];
					}
				},
				{
					title:"职业类型",
					key:"type",
					align: 'center',
					// width: 120,
					render(h, params) {
						return ['', '医师', '药师'][Number(params.row.type)];
					}
				},
				{
					title:"科室",
					key:"deptName",
					align: 'center',
					// width: 120,
				},
				{
					title:"医师职称",
					key:"titleName",
					align: 'center',
					// width: 120,
				},
				{
					title:"联系电话",
					key:"phone",
					align: 'center',
					// width: 120,
				},
				{
					title:"设置",
					align: 'center',
					width: 120,
					render: (h,params) => {
						let a = params.row
						if(!this.cstbdisabled){
							return h('div', [
								h('span', {
									style: {
										color: " #21c780",
										marginRight: "5px",
									},
									on: {
										click: () => {
											this.handleEdit(a.id,a.type)
										}
									}
								}, '编辑'),
								'|',
								h('span', {
									style: {
										color: " #fc6c49",
										marginLeft: "5px",
									},
									on: {
										click: () => {
											this.delDoctor(a.id)
										}
									}
								}, '删除')
							])
						}
						if(this.cstbdisabled) {
							return h('div', [
								h('span', {
									style: {
										color: " #21c780",
										marginRight: "5px",
									},
									on: {
										click: () => {
											this.handlelook(a.id,a.type)
										}
									}
								}, '查看'),
							])
						}
					}
				}
			],
			hospitalId: '',
			infoProteLevel:[],             //信息系统安全等级保护级别
			emrLevel:[],             //电子病历等级
			economics:[],             //经济类型
			yljglb:[],             //组织类
			kbahospitalLevel:[],       //机构等位分级
			reviewStatus: '',       //审核状态
			titletxt: '审核弹窗',       
			showDelModal: false,       
			bohui: '',     
			file: [],  
			uploadFile: [],  
			diseasepicture: '',
			infopicture: '',
			drdisabled:false,
			cstb:'',
			cstbdisabled: false,
		};
  	},
	created() {
		this.hospitalId = cookie.getCookie("JGhospitalId");
		// console.log('监管机构id',this.hospitalId)
		this.formValidate.orgCode = cookie.getCookie("orgCode");
		// console.log('社会信用代码',this.formValidate.orgCode)
		this.formValidate.orgName = cookie.getCookie("orgName");
		this.province = this.$route.query.province
		? parseInt(this.$route.query.province)
		: null;
		this.city = this.$route.query.city
		? parseInt(this.$route.query.city)
		: null;
		this.area = this.$route.query.area
		? parseInt(this.$route.query.area)
		: null;
		this.reviewStatus = this.$route.query.reviewStatus
		? this.$route.query.reviewStatus
		: null; 
		this.cstb = this.$route.query.type
		? this.$route.query.type
		: null;
		if(this.cstb){
			this.cstbdisabled = true
		}
		this.bohui = this.$route.query.bohui
		? this.$route.query.bohui
		: null;
		let breadList = [
		{ path: "/index", title: "首页" },
		{
			path: "/index/maintain/indexManagement/index",
			title: "索引管理"
		},
		{
			path: "/index/maintain/mechanismreg/list",
			title: "医疗机构注册"
		}
		];
		this.$emit("changeBreadList", breadList);
	},
	computed: {
		notReview() {
			return this.mode !== 'review';
		},
		//互联网医疗服务
		allServerList() {
			if(this.allServiceList){
				//循环获取child
				this.allServiceList.forEach(a =>{
					a.selected = 0;
					a.flag = false
					if(this.docServiceList){
						this.docServiceList.forEach(d =>{
							if(a.id == d.menuId){
								a.selected = 1;
								a.flag = true;
								return;
							}
						})
					}
				})
			}
			return this.allServiceList;
		}
	},
	mounted() {   
		this.hospitalId = this.$route.query.hospitalId;
		this.formValidate.id = this.hospitalId;
		this.uploadList1 = this.$refs.upload1.fileList;
		this.uploadList2 = this.$refs.upload2.fileList;
		this.uploadList3 = this.$refs.upload3.fileList;
		this.uploadList4 = this.$refs.upload4.fileList;
		this.uploadList5 = this.$refs.upload5.fileList;
		this.uploadList9 = this.$refs.upload9.fileList;
		this.uploadList10 = this.$refs.upload10.fileList;
		//获取省级信息
		this.getCity();
	
		// 获取单位隶属
		this.getLastHospital();
		
		//获取全部互联网医疗服务
		this.$axios.post(api.findHospitalMenuList,{}).then(resp => {
		if (resp.data.code == 1) {
			let tmpData = resp.data.object;
			this.allServiceList = tmpData;
			this.allServiceList.forEach(a =>{
				a.selected = 0;
				a.flag = false
			})
		}
		}).catch(err => {
			console.log(err);
		}); 
		//获取科室列表
		this.getdepartmentList()
		//获取医生列表      
		this.getdoctorList()  
		//获取字典 
		this.getGrade()  
		//获取机构相关详情
		if(this.mode !== 'add') {
			this.showSpin = true;
		  	this.getItemdetail()
		}
	},
  	methods: {
		//获取资质申请详情
		getItemdetail() {
			this.$axios
		    .post(api.findSuperviseHospitalById, {
		      id: this.hospitalId
		    }).then(res => {
		      if (res.data.code === 1) {
		        // 利用返回数据填充 前端数据
				console.log('详情信息',res.data.object)
		        const ret = JSON.parse(JSON.stringify(res.data.object));
				let hospitalCertList = this.formValidate.hospitalCertList;
		        this.formValidate = Object.assign({}, this.formValidate, ret);
				this.formValidate.hospitalCertList = hospitalCertList;
				this.reviewStatus = this.formValidate.reviewStatus
				//获取已选中的互联网医疗服务
				this.docServiceList = ret.menuList;
				// console.log('已选中的互联网医疗服务',this.docServiceList)
		        //对 ret.certlist 进行 this.formValidate.certListmerge 进行merge 以兼容旧数据;
				if(ret.hospitalCertList){
					this.formValidate.hospitalCertList.forEach((item, index) => {
						ret.hospitalCertList.forEach((c,j)=>{
							if(item.type == c.type){
								ret.hospitalCertList[j] = Object.assign({},  item,  ret.hospitalCertList[j] || {})
							}
						})
					})
					ret.hospitalCertList.forEach((item, index) => {
						if (item.filePath && item.filePath != "{}") {
							item.filePath = JSON.parse(item.filePath);
							if (!Array.isArray(item.filePath)) {
								item.filePath = [item.filePath];
							}
							item.filePath.forEach((item2, index) => {
								this.$refs['upload' + item.type].fileList.push({
									status: "finished",
									url: item2.fileName,
									res: item2,	
									uid: index
								});
							});
						} 
						else {
							this.$refs['upload' + item.type] = []
						}
					});
				}
				if(this.formValidate.situation){
					this.formValidate.safetyLevel = this.formValidate.situation.safetyLevel
					this.technicalManual = this.formValidate.situation.technicalManual;
					this.technicalManualUrl = this.formValidate.situation.technicalManualUrl;
					this.operationManual = this.formValidate.situation.operationManual;
					this.operationManualUrl = this.formValidate.situation.operationManualUrl;
					this.researchReport = this.formValidate.situation.researchReport;
					this.researchReportUrl = this.formValidate.situation.researchReportUrl;
					if (this.formValidate.situation.emrCer) {
						this.uploadList10.push({
							status: "finished",
							uid: 1544263544970,
							res: JSON.parse(this.formValidate.situation.emrCer),	
							url: this.pictureFormat(this.formValidate.situation.emrCer)
						});
					}
					if (this.formValidate.situation.safetyCert) {
						this.uploadList9.push({
							status: "finished",
							uid: 1544263544970,
							res: JSON.parse(this.formValidate.situation.safetyCert),	
							url: this.pictureFormat(this.formValidate.situation.safetyCert)
						});
					}
				}
				if(this.formValidate.protocolList){
					this.formValidate.protocolList.forEach(item=>{
						if(item.protocolType === "1"){
							this.patientProtocol = item
						} else if(item.protocolType === "2"){
							this.doctorProtocol = item
						} else {
							this.otherProtocol = item
						}
					})
				}
				if(this.formValidate.thirdpartyHospital){
					this.creditCert = this.formValidate.thirdpartyHospital.creditCert
					this.creditCertUrl = this.formValidate.thirdpartyHospital.creditCertUrl
					this.contract = this.formValidate.thirdpartyHospital.contract
					this.contractUrl = this.formValidate.thirdpartyHospital.contractUrl
				}
		        // 省市区反显
		        this.formValidate.provinceCode = String(ret.provinceCode);
		        this.formValidate.cityCode = String(ret.cityCode);
		        this.formValidate.districtCode = String(ret.districtCode);
		        this.showSpin = false;
				this.formValidate.situation.qualitySupervision = Boolean(ret.situation.qualitySupervision)
					this.formValidate.situation.technicalSupervision = Boolean(ret.situation.technicalSupervision)
					this.formValidate.situation.serviceSupervision = Boolean(ret.situation.serviceSupervision)
					this.formValidate.situation.isShare = Boolean(ret.situation.isShare)
		      } else {
		        this.$Message.error(ret.data.message);
		      }
		    });
		},
		//获取字典
		getGrade() {
			this.$axios.post(api.findDictType, {}).then(resp => {
				let ret = resp.data.object
				this.infoProteLevel = ret.SECURITY_PROTECTION_LEVEL
				this.emrLevel = ret.EMR_LEVEL
				this.economics = ret.ECONOMICS
				this.yljglb = ret.YLJGLB
				this.kbahospitalLevel = ret.KBA_HOSPITAL_LEVEL
			}).catch(err => {
				console.log(err);
			});
		},
		//单位介绍
		getUploadUrl(map){
            this.formValidate.hosIntroductionUrl = map.url;
            this.formValidate.hosIntroduction = map.name;
        },
		//信息系统技术手册文件
		gettechnicalManualUrl(map){
            this.formValidate.situation.technicalManualUrl = map.url;
            this.formValidate.situation.technicalManual = map.name;
            this.technicalManualUrl = map.url;
            this.technicalManual = map.name;
        },
		//信息系统操作手册文件
		getoperationManualUrl(map){
            this.formValidate.situation.operationManualUrl = map.url;
            this.formValidate.situation.operationManual = map.name;
            this.operationManualUrl = map.url;
            this.operationManual = map.name;
        },
		//互联网医院设立可行性研究报告
		getresearchReportUrl(map){
            this.formValidate.situation.researchReportUrl = map.url;
            this.formValidate.situation.researchReport = map.name;
            this.researchReportUrl = map.url;
            this.researchReport = map.name;
        },
		//第三方合作统一社会信用代码证书文件
		getcreditCertUrl(map){
            this.formValidate.thirdpartyHospital.creditCertUrl = map.url;
            this.formValidate.thirdpartyHospital.creditCert = map.name;
            this.creditCertUrl = map.url;
            this.creditCert = map.name;
        },
		//第三方合作协议合同文件
		getcontractUrl(map){
            this.formValidate.thirdpartyHospital.contractUrl = map.url;
            this.formValidate.thirdpartyHospital.contract = map.name;
            this.contractUrl = map.url;
            this.contract = map.name;
        },
		//协议类型：患者端协议
		getPatientProtocolUrl(map){
            this.patientProtocol.protocolContentUrl = map.url;
            this.patientProtocol.protocolContent = map.name;
        },
		//协议类型：医生端协议
		getDoctorProtocolUrl(map){
            this.doctorProtocol.protocolContentUrl = map.url;
            this.doctorProtocol.protocolContent = map.name;
        },
		//协议类型：患者端协议
		getOtherProtocolUrl(map){
            this.otherProtocol.protocolContentUrl = map.url;
            this.otherProtocol.protocolContent = map.name;
        },
		changeDrdisabled() {
			this.drdisabled = false
			// this.formValidate.hospitalCertList = null
		},
		//调取导入机构信息
		leading() {
			this.drdisabled = true
			if(!this.formValidate.orgCode){
				this.$Message.error('请输入‘统一社会信用代码’');
				this.drdisabled = false
				return;
			}
			for(let i=1; i<=5; i++){
				if(this['uploadList' + i].length>0){
					this.onremove(i, this['uploadList' + i][0]);
				}
			}
			this.$axios.post(api.findHospitalDetail, {orgCode: this.formValidate.orgCode,orgName: this.formValidate.orgName}).then(res => {
				if (res.data.code === 1) {
		        // 利用返回数据填充 前端数据
		        const ret = JSON.parse(JSON.stringify(res.data.object));
				console.log('导入数据',ret)
				this.hospitalId = ret.id
		        this.formValidate = Object.assign({}, this.formValidate, ret);
				this.docServiceList = ret.menuList;
		        //对 ret.certlist 进行 this.formValidate.certListmerge 进行merge 以兼容旧数据;
				if(ret.hospitalCertList && this.formValidate.hospitalCertList){
					this.formValidate.hospitalCertList.forEach((item, index) => {
						ret.hospitalCertList.forEach((c,j)=>{
							if(item.type == c.type){
								ret.hospitalCertList[j] = Object.assign({},  item,  ret.hospitalCertList[j] || {})
							}
						})
					})
					ret.hospitalCertList.forEach((item, index) => {
						console.log(item.filePath)
						if (item.filePath && item.filePath != {}) {
							item.filePath = JSON.parse(item.filePath);
							if (!Array.isArray(item.filePath)) {
								item.filePath = [item.filePath];
							}
							item.filePath.forEach((item2, index) => {
								this.$refs['upload' + item.type].fileList.push({
									status: "finished",
									url: item2.fileName,
									res: item2,
									uid: index
								});
							});
						} else {
							this.$refs['upload' + item.type] = []
						}
					});
				}
				if(this.formValidate.situation){
					this.formValidate.safetyLevel = this.formValidate.situation.safetyLevel
				}
		        // 省市区反显
		        this.formValidate.provinceCode = String(ret.provinceCode);
		        this.formValidate.cityCode = String(ret.cityCode);
		        this.formValidate.districtCode = String(ret.districtCode);
		        this.showSpin = false;
				//获取科室列表
				this.getdepartmentList()
				//获取医生列表      
				this.getdoctorList()  
		      } else {
				this.drdisabled = false
		        this.$Message.error(res.data.message);
		      }
				// this.formValidate = resp.data.object
				// if(resp.data.object.situation) {
				// 	this.formValidate.situation = resp.data.object.situation
				// 	this.formValidate.safetyLevel = this.formValidate.situation.safetyLevel
				// } else {
				// 	this.formValidate.situation = ''
				// }
				// if(resp.data.object.thirdpartyHospital) {
				// 	this.formValidate.thirdpartyHospital = resp.data.object.thirdpartyHospital
				// } else {
				// 	this.formValidate.thirdpartyHospital = ''
				// }
				// if(resp.data.object.protocolList) {
				// 	this.formValidate.protocolList = resp.data.object.protocolList
				// } else {
				// 	this.formValidate.protocolList = ''
				// }
				// if(resp.data.object.hospitalCertList) {
				// 	this.formValidate.hospitalCertList = resp.data.object.hospitalCertList
				// } else {
				// 	this.formValidate.hospitalCertList = ''
				// }
			}).catch(err => {
				this.drdisabled = false
				console.log(err);
			});
		},
		//新建的机构先保存来获取hospitalId
		getNewhospitalId() {
			this.$axios
				.post(api.insertSupervise, this.formValidate)
				.then(res => {
					if (res.data.code) {
						let ret = res.data;
					} else {
						this.disabled = false 
						this.disabledZC = false 
						this.$Message.error(res.data.message);
					}
				})
				.catch(err => {
					this.disabled = false
					this.disabledZC = false
				});
		},
		//获取医生列表
		getdoctorList() {
			this.$axios.post(api.findSuperviseDoctorList, {hospitalid: this.hospitalId}).then(resp => {
				let ret = resp.data.object
				this.tableList = ret;
			}).catch(err => {
				console.log(err);
			});
		},
		//添加医生
		addDoctor() {
			if(!this.hospitalId) {
				//新建的机构先保存来获取hospitalId
				this.$axios
					.post(api.insertSupervise, this.formValidate)
					.then(res => {
						if (res.data.code) {
							let ret = res.data.object;
							this.hospitalId = ret
							this.functionJS.queryNavgationTo(this, "/index/doctorOperation/doctorregister/add", {
								hospitalId: this.hospitalId,
								jgtype: 'jianguan'
							});	
						} else {
							this.$Message.error(res.data.message);
						}
					})
					.catch(err => {
						this.$Message.error(res.data.message);
					});
			} else {
				this.functionJS.queryNavgationTo(this, "/index/doctorOperation/doctorregister/add", {
					hospitalId: this.hospitalId,
					jgtype: 'jianguan'
				});	
			} 
		},
		//新增药师
		addpharmacist() {
			if(!this.hospitalId) {
				//新建的机构先保存来获取hospitalId
				this.$axios
					.post(api.insertSupervise, this.formValidate)
					.then(res => {
						if (res.data.code) {
							let ret = res.data.object;
							this.hospitalId = ret
							this.functionJS.queryNavgationTo(this, "/index/doctorOperation/pharmacyregister/add", {
								hospitalId: this.hospitalId,
								jgtype: 'jianguan'
							});	
						} else {
							this.$Message.error(res.data.message);
						}
					})
					.catch(err => {
						this.$Message.error(res.data.message);
					});
			} else {
				this.functionJS.queryNavgationTo(this, "/index/doctorOperation/pharmacyregister/add", {
					hospitalId: this.hospitalId,
					jgtype: 'jianguan'
				});	
			} 
		},
		//查看医生
		handlelook(val,el) {			
			this.functionJS.queryNavgationTo(this, "/index/doctorOperation/pharmacyregister/review", {
				hospitalId: this.hospitalId,
				jgtype: 'jianguan',
				id: val
			});	
		},
		//编辑医生
		handleEdit(val,el) {
			if(el == 1) {
				this.functionJS.queryNavgationTo(this, "/index/doctorOperation/doctorregister/edit", {
					hospitalId: this.hospitalId,
					jgtype: 'jianguan',
					id: val
				});	
			} else {
				this.functionJS.queryNavgationTo(this, "/index/doctorOperation/pharmacyregister/edit", {
					hospitalId: this.hospitalId,
					jgtype: 'jianguan',
					id: val
				});	
			}
		},
		//删除医生
		delDoctor(val) {
			this.$axios.post(api.updateSuperviseDoctor, {id: val}).then(resp => {
				this.$Message.success("删除成功");
				this.getdoctorList()
			}).catch(err => {
				console.log(err);
			});
		},
		//获取科室列表
		getdepartmentList() {
			this.$axios.post(api.findSuperviseDeptList, {hospitalId: this.hospitalId}).then(resp => {
				let ret = resp.data.object
				this.departmentList = ret;
			}).catch(err => {
				console.log(err);
			});
		},
		//新增科室
		insertDept() {
			// if(!this.hospitalId) {
				//新建的机构先保存来获取hospitalId
			let arr = [];
			// 循环已操作的数据 找出已经选中数据的ID
			this.allServerList.forEach(item =>{
				if(item){
					if(Boolean(item.flag)){
						arr.push(item.id)
					}
				}
			})  
			if(this.patientProtocol){
				this.formValidate.protocolList.push(this.patientProtocol);
			}
			if(this.doctorProtocol){
				this.formValidate.protocolList.push(this.doctorProtocol);
			}
			if(this.otherProtocol){
				this.formValidate.protocolList.push(this.otherProtocol);
			}
			this.formValidate.menuIds = arr
			this.$axios
				.post(api.insertSupervise, this.formValidate)
				.then(res => {
					if (res.data.code) {
						let ret = res.data.object;
						this.hospitalId = ret
						this.functionJS.queryNavgationTo(this, "/index/organizat/contentmen/medicine/add", {
							hospitalId: this.hospitalId,
							type: 'jianguan'
						});	
					} else {
						this.$Message.error(res.data.message);
					}
				});
			// } else {
			// 	this.functionJS.queryNavgationTo(this, "/index/organizat/contentmen/medicine/add", {
			// 		hospitalId: this.hospitalId,
			// 		type: 'jianguan'
			// 	});	
			// } 
		},
		//删除科室
		deldepartment(val) {
			this.$axios.post(api.updateSuperviseDept, {id: val}).then(resp => {
				this.$Message.success("删除成功");
				this.getdepartmentList()
			}).catch(err => {
				console.log(err);
			});
		},
		//审核弹窗
		showDelModalClick(val) {
			this.showDelModal = true
			if(val == 3) {
				this.titletxt = '驳回弹窗'
				this.reviewType = 3
			} else {
				this.reviewType = 2
			}
		},
		//审核
		check() {
			this.$axios.post(api.updateReviewType, {id: this.formValidate.id,reviewStatus:this.reviewType, reviewComments :this.reviewComments}).then(resp => {
				this.$Message.success("操作成功");
				this.showDelModal = false
				this.$router.go(-1)
			}).catch(err => {
				console.log(err);
			});
		},
		back() {
			this.$router.go(-1)
			// this.functionJS.queryNavgationTo(
			// 	this,
			// 	"/index/supervision/qualificationApply/list",
			// 	{
			// 		pageNo: this.$route.query.pageNo,
			// 		province: this.province,
			// 		city: this.city,
			// 		area: this.area,
			// 		hospital: this.hospital,
			// 		isBack: 2
			// 	}
			// );
		},
		genAddressRule(formValidate) {
			const that = this;
			return {
				required: true,
				trigger: "change",
				validator: (rule, value, callback) => {
					if (!formValidate.provinceCode) {
						callback(new Error("请选择省份"));
					} else if (!formValidate.cityCode) {
						callback(new Error("请选择市"));
					} else if (!formValidate.districtCode) {
						callback(new Error("请选择区"));
					} else {
						callback();
					}
				}
			};
		},
		// 获取单位隶属
		getLastHospital() {
			this.$axios.post(api.findSuperviseHospitalList, {hospitalType: 1}).then(res => {
				if (res.data.success) {
					let ret = res.data.object || [];
					console.log(ret)
					this.hospitalSuperior = ret.map(item => { return {orgCode: item.orgCode, orgName: item.orgName}});
				}
			});
		},
		//       控制图片上传开始---------------------------------------------------------------------
		onremove (type, file) {
			const fileList = this.$refs['upload' + type].fileList;
			this.$refs['upload' + type].fileList.splice(fileList.indexOf(file), 1);       
		},
		// 文件上传成功触发的函数
		handleSuccess(res, file, type) {
			res = this.uploadFileDecrypt(res);
			if (res.success) {
				file.res = res.object[0];
			} else {
				this.$Message.error("上传失败,请重试");
			}
		},
		handleSuccessDisease(res, file, type) {
			res = this.uploadFileDecrypt(res);
			if (res.success) {
				file.res = res.object[0];
				this.formValidate.situation.emrCer = JSON.stringify(res.object[0]);
			} else {
				this.$Message.error("上传失败,请重试");
			}
		},
		handleSuccessInfo(res, file, type) {
			res = this.uploadFileDecrypt(res);
			if (res.success) {
				file.res = res.object[0];
				this.formValidate.situation.safetyCert = JSON.stringify(res.object[0]);
			} else {
				this.$Message.error("上传失败,请重试");
			}
		},
		// // 查看预览图片
		handleView(item) {
			this.viewModal = true;
			this.viewSrc = this.fileBaseUrl + item.res.fileName;
		},
		preview(type) {
			if (type !== '7') {
				const check = this['uploadList' + type].length < 1;
				if (!check) {
					this.$Message.info("只能上传一张图片");
					return false;
				}
			}
		},
		// 控制图片上传结束-------------------------------------------------------------------------
		// 上传图片大小错误提醒
		handleMaxSize() {
			this.$Message.error("上传图片大小不能超过200kb");
		},
		// 上传图片格式错误提醒
		uploadFormatError() {
			this.$Message.error("上传图片类型只能是jpg格式");
		},
		//选择省
		changeProvince(val) {
			this.formValidate.provinceCode = val;
			this.provList = this.$store.getters.getProvinceList
			this.provList.forEach(i =>{
				if (i.id == this.formValidate.provinceCode) {
					this.formValidate.provinceName = i.name
				}
			})
		},
		changeCity(val) {
			this.formValidate.cityCode = val
			this.cityList = this.$store.getters.getCityList(this.formValidate.provinceCode);
			this.cityList.forEach(i =>{
				if (i.id == this.formValidate.cityCode) {
					this.formValidate.cityName = i.name
				}
			})
		},
		changeArea(val) {
			this.formValidate.districtCode = val;
			this.countyList = this.$store.getters.getAreaList(this.formValidate.cityCode);
			this.countyList.forEach(i =>{
				if (i.id == this.formValidate.districtCode) {
					this.formValidate.districtName = i.name
				}
			})
		},
		// 获取省级
		getCity() {
			this.$axios.post(api.getCity,{}).then(res => {
				if (res.data) {
				let ret = res.data.object;
				ret.forEach(item => {
					item.id = item.id.toString();
				});
				this.provList = ret;
				this.countyList = [];
				this.cityList = [];
				}
			});
		},
		// 提交表单
		handleSubmit(name,val) {
			if(val==1) {
				this.disabled = true
			} else {
				this.disabledZC = true
			}	    
			this.$refs[name].validate(valid => {
				if (valid) {
					this.formValidate.situation.qualitySupervision = Number(this.formValidate.situation.qualitySupervision)
					this.formValidate.situation.technicalSupervision = Number(this.formValidate.situation.technicalSupervision)
					this.formValidate.situation.serviceSupervision = Number(this.formValidate.situation.serviceSupervision)
					this.formValidate.situation.isShare = Number(this.formValidate.situation.isShare)
					if(this.patientProtocol){
						this.formValidate.protocolList.push(this.patientProtocol);
					}
					if(this.doctorProtocol){
						this.formValidate.protocolList.push(this.doctorProtocol);
					}
					if(this.otherProtocol){
						this.formValidate.protocolList.push(this.otherProtocol);
					}
					//上传'图片'字段内容填充
					if(this.formValidate.hospitalCertList){
						this.formValidate.hospitalCertList.forEach((item, index) => {
							if (item.type == '5') {
								item.filePath = this['uploadList' + item.type].map((item) => item.res)
							} else {
								item.filePath = this['uploadList' + item.type].map((item) => item.res);
							}
						});
					}
					if(this.hospitalSuperior){
						this.hospitalSuperior.forEach(i =>{
							if(i.orgCode == this.formValidate.orgParentCode){
								this.formValidate.orgParentName = i.orgName
							}
						})
					}
					if(this.SuperiorList){
						this.SuperiorList.forEach(i =>{
							if(i.dictType == this.formValidate.grade){
								this.formValidate.gradeName  = i.dictName
							}
						})
					}
					let arr = [];
					// 循环已操作的数据 找出已经选中数据的ID
					this.allServerList.forEach(item =>{
						if(!item){
							this.$Message.error("请选择互联网医疗服务");
							return
						}else{
							if(Boolean(item.flag)){
								arr.push(item.id)
							}
						}
					})  
					this.formValidate.menuIds = arr
					this.formValidate.reviewStatus = val
					if(this.departmentList.length<1) {
						this.$Message.error("请先添加临床科室");
						return
					} else {
						this.formValidate.deptList = this.departmentList
					}
					//组织类名称
					// this.yljglb.forEach(i=>{
					// 	if(this.formValidate.hospitalNature == i.dictType){
					// 		this.formValidate.hospitalNatureName = i.dictName
					// 	}
					// })
					//机构等位分级名称
					this.kbahospitalLevel.forEach(i=>{
						if(this.formValidate.grade == i.dictType){
							this.formValidate.gradeName = i.dictName
						}
					})
					//经济类型名称
					this.economics.forEach(i=>{
						if(this.formValidate.economicType == i.dictType){
							this.formValidate.economicTypeName = i.dictName
						}
					})
					//信息系统安全等级保护级别名称
					this.formValidate.situation.safetyLevel = this.formValidate.safetyLevel
					this.infoProteLevel.forEach(i=>{
						if(this.formValidate.situation.safetyLevel == i.dictType){
							this.formValidate.situation.safetyLevelName = i.dictName
						}
					})
					//信息系统安全等级保护级别名称
					this.emrLevel.forEach(i=>{
						if(this.formValidate.situation.emrLevel == i.dictType){
							this.formValidate.situation.emrLevelName = i.dictName
						}
					})
					// if(this.mode === 'add') {
					// 	this.formValidate.id = ''
					// }
					console.log('入参',this.formValidate)
					this.$axios
					.post(api.insertSupervise, this.formValidate)
					.then(res => {
						if (res.data.code) {
							let ret = res.data;
							this.mode === 'add' && this.$Message.success("添加成功");
							this.mode === 'edit' && this.$Message.success("修改成功");
							if(val==1) {
								this.disabled = false
							} else {
								this.disabledZC = false
							}	   
							this.back();
						} else {
							if(val==1) {
								this.disabled = false
							} else {
								this.disabledZC = false
							}	    
							this.$Message.error(res.data.message);
						}
					})
					.catch(err => {
						if(val==1) {
							this.disabled = false
						} else {
							this.disabledZC = false
						}	   
					});
				} else {
					if(val==1) {
						this.disabled = false
					} else {
						this.disabledZC = false
					}	   
					// 必填项填写失败
					this.$Message.error("请检查必填项是否填写正确！");
				}
			});
		},
		//上传文件开始
		importExcel(url){
                this.modalImport = true;
                this.$refs.upload.clearFiles();//清除上次上传记录
                this.file = [];
                this.uploadFile = [];
        },
		uploadSuccess(response, file, fileList){
			this.$Message.info(response.msg);
			// this.modalImport = false
			this.init(0, 20);
		},
		clear(){
			this.$refs.upload.clearFiles();//清除上次上传记录
		},
		handleUploadword (file) { // 上传文件前的事件钩子
			
			// 选择文件后 这里判断文件类型 保存文件 自定义一个keyid 值 方便后面删除操作
			let keyID = Math.random().toString().substr(2);
			file['keyID'] = keyID;
			// 保存文件到总展示文件数据里
			this.file.push(file);
			// 保存文件到需要上传的文件数组里
			this.uploadFile.push(file)
			// 返回 falsa 停止自动上传 我们需要手动上传
			//如果需要手动上传文件，需要把这里注释放开并放开上面代码块中的被注释的两个按钮，就可以进行手动上传了
			//return false
		},
		upload () { // 上传文件
			for (let i = 0; i < this.uploadFile.length; i++) {
				let item = this.file[i]
				this.$refs.upload.post(item);
			}
			
		},    
	},
	watch: {
		formValidate(n) {
			console.log(n)
		},
		hospitalSuperior(n) {
			console.log(n)
		},
		'formValidate.provinceCode'(n){
			console.log(n);
		},
		city(n){
			console.log(n);
		},
		area(n){
			console.log(n);
		}
	}
};
</script>
<style lang='less' scoped>
.mechanismregAdd {
  width: 100%;
  box-sizing: border-box;
  .container {
    width: 100%;
    margin-bottom: 40px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    .container-main {
      flex-direction: column;
      width: 100%;
      .left-part {
        width: 98%;
        margin: 20px auto;
        margin-left: 1%;
        margin-bottom: 20px;
        border: 1px solid #f0f0f0;
        box-shadow: 0 4px 3px #ebedf8;
        border-radius: 5px;
        .title {
          font-size: 20px;
          padding-left: 15px;
          margin-bottom: 20px;
          color: #333;
          height: 40px;
          line-height: 40px;
          background: #ebedf8;         
        }
        .left {
          flex: 0 0 auto;
          // width: 140px;
          text-align: left;
          margin-right: 5px;
		  margin-bottom: 24px;
        }
        .right {
          width: 94%;
          text-align: left;
        }
      }
      .right-part {
        width: 98%;
        margin-left: 1%;
        margin-bottom: 20px;
        border: 1px solid #f0f0f0;
        box-shadow: 0 4px 3px #ebedf8;
        border-radius: 5px;
        .title {
          font-size: 20px;
          padding-left: 15px;
          margin-bottom: 10px;
          color: #333;
          height: 40px;
          line-height: 40px;
          background: #ebedf8;
        }
        .left {
          flex: 0 0 auto;
          // width: 210px;
          text-align: left;
          margin-right: 10px;
        }
        .upload-part {
          display: flex;
          position: relative;
          align-items: center;
          top: -10px;
        //   margin-left: 35px;
          margin: 10px 0 0 30px;
        }
        /deep/ .ivu-input {
          width: 200px;
          margin-right: 20px;
        }
      }
	  .demo-upload-list {
            display: inline-block;
            width: 100px;
            height: 100px;
            text-align: center;
            line-height: 100px;
            border: 1px solid transparent;
            border-radius: 4px;
            overflow: hidden;
            background: #fff;
            position: relative;
            box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
            margin-right: 4px;
          }
          // 关闭input文本框自动填充背景色黄色
          input:-webkit-autofill {
            box-shadow: 0 0 0px 1000px white inset !important;
          }

          .demo-upload-list img {
            width: 100%;
            height: 100%;
          }
          .demo-upload-list-cover {
            display: none;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, 0.6);
          }
          .demo-upload-list:hover .demo-upload-list-cover {
            display: block;
          }
          .demo-upload-list-cover i {
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            margin: 0 2px;
          }
      .button-bottom {
        margin: 20px 0;
        text-align: center;
        button {
          min-width: 100px;
          // height: 50px;
        }
      }
      .ivu-col-offset-6 {
        margin: 0px;
      }
      .region,
      .address {
        display: flex;
        // flex-direction: row;    
        margin-left: 35px;
        .left {
          font-size: 14px;
          padding-top: 5px;
          span:last-child {
            font-weight: 600;
          }
        }
        input {
          display: inline-block;
          width: 400px;
          border: 1px solid black;
          line-height: 30px;
          outline: none;
          background: #fff;
          text-indent: 5px;
        }
      }
      .hongdian{
        margin-left: 25px;
      }
	  .tubiao {
        font-size:16px;
        margin-right:5px;
      }
      .region {
        .ivu-col-span-6 {
        }
        select {
          width: 100px;
          // margin-right: 20px;
          outline: none;
          option {
            text-align: center;
          }
        }
      }
      .hosAddr {
        margin-left: 500px;
      }
		.protocol {
			display: flex;
			margin: 0 40px;
			padding-bottom: 15px;
			.sort {
				width: 40%;
				margin-right: 30px;
				font-size: 14px;
				font-weight: 550;
			}
			.dsort {
				width: 16%;
				margin-right: 20px;
				font-size: 14px;
				font-weight: 550;
			}
			.asd {
				display: flex;
				.inputbox {
					width:83%;
					margin-left: 10px;
				}
			}
		}
	 	.b {
			font-size: 14px;
			color: #ff9966;
			margin-left: 20px;
		} 
    }
    .fuwu {
        width: calc(100%);
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid rgb(242, 242, 242);
        .xsfw {
            margin: 0;
            .select_wufu {
                margin: 0 30px;
                display: flex;
                flex-direction: row;
                padding-left: 20px;
                align-items: center;
                flex-wrap: wrap;
                div {
                    width: 13%;
                    margin: 10px 20px;
                    display: flex;
                    flex-direction: row;
                    align-items: center;
					font-size: 14px !important;
					font-weight: 550;
                    input {
                        outline: none;
                        border: none;
                    }
                }
            }
        }
    }
	.tablebox{
		margin: 0 30px 20px 30px;
	}
	.page{
        text-align: center;
        margin-top: 20px;
    }
  }
}
.ivu-checkbox-wrapper{
	font-size: 14px !important;
}
.button-upload {
  margin-left: 10px;
  margin-right: 10px;
}
.ivu-upload {
  display: flex;
  .ivu-upload-select {
    height: 100%;
  }
  /deep/ .ivu-upload-list {
    height: 100%;
    margin-top: -10px;
    padding-left: 4px;
    padding-right: 4px;
    .ivu-upload-list-file {
      padding: 0px;
    }
  }
}
</style>
